package br.com.yk.client.ui;

import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.form.FormPanel;
import com.gwtext.client.widgets.form.TextField;

public class LoginForm extends Panel {
	
	private TextField txtLoginName = null;
	private TextField txtPassword = null;
	private Button btLogin = null;
	private FormPanel frmPanel = new FormPanel();
	   
	public LoginForm() {
		super();
		createComponents();
	}
	/**
	 * 
	 */
	private void createComponents() {
		frmPanel.setFrame(true);
		frmPanel.setTitle("Login");
		frmPanel.setWidth(300);
		frmPanel.setLabelWidth(75);
		 
		txtLoginName = new TextField("Nome", "userName", 150);
		txtLoginName.setAllowBlank(false);
		txtLoginName.focus();
		frmPanel.add(txtLoginName );
		
		// password
		txtPassword = new TextField("Senha", "pswd", 150);
		txtPassword.setInputType("password");
		txtLoginName.setAllowBlank(false);
		frmPanel.add(txtPassword);
		
		// btLogin
		btLogin = new Button("Login");
		frmPanel.add(btLogin);
		
		this.setBorder(false);
		this.setPaddings(5);
		this.add(this.frmPanel);
		this.addClass("LoginPanel");
	}
	public Button getBtLogin() {
		return btLogin;
	}
	public void setBtLogin(Button btLogin) {
		this.btLogin = btLogin;
	}
	public TextField getTxtLoginName() {
		return txtLoginName;
	}
	public void setTxtLoginName(TextField txtLoginName) {
		this.txtLoginName = txtLoginName;
	}
	public TextField getTxtPassword() {
		return txtPassword;
	}
	public void setTxtPassword(TextField txtPassword) {
		this.txtPassword = txtPassword;
	}
}
